package com.hakim.wfb.common.enums;

/**
 * Created by leichen3 on 2017/7/21.
 */
public enum AchivementEnum {

    SELF_ACHIVEMENT(1, "个人业绩"),
    TEAM_ACHIVEMENT(2, "团队业绩"),
    SUM_ACHIVEMENT(3, "总业绩");

    private int value;
    private String description;

    private AchivementEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static AchivementEnum getByValue(int value) {
        AchivementEnum[] codes = values();
        for (AchivementEnum each : codes) {
            if (each.value == value) {
                return each;
            }
        }
        return null;
    }
}
